<?php defined('IN_PHPCMS') or exit('Access Denied'); ?><?php include template('phpcms','header'); ?>
<!--begin main-->
<div id="main">
  <div id="main_l" class="bdr_1">
    <!--位置导航-->
    <div id="position"><a href="">首页</a><?php echo catpos($r['catid']);?></div>
    <div id="content">
      <div id="content_head">
        <!--文章标题-->
        <h1><?php if($titleintact) { ?><?php echo $titleintact;?><?php } else { ?><?php echo $title;?><?php } ?></h1>
        <!--基本属性-->
        <h2><span><?php echo $updatetime;?></span> 作者：<?php if($author) { ?><?php echo $author;?><?php } else { ?><?php echo $userid;?><?php } ?> 来源：<?php echo $copyfrom;?> <?php if($PHPCMS[show_hits]) { ?>浏览次数：<span id="hits">0</span><?php } ?> 
<?php if(isset($MODULE[comment])) { ?><?php list($keyid, $verify) = keyid_make('phpcms', 'content', 'title', $contentid);?>
<a href="<?php echo $MODULE['comment']['url'];?>?keyid=<?php echo $keyid;?>&verify=<?php echo $verify;?>" style="color:red;">网友评论 <span id="comments_top">0</span> 条</a>
<?php } ?></h2>
      </div>
      <!--简单描述-->
      <?php if($description) { ?>
      <div id="digest"><?php echo $description;?></div>
      <?php } ?>
      <!--正文-->
      <div id="endtext">
<?php if($allow_priv) { ?><!--判断阅读权限-->
<?php if($allow_readpoint) { ?><!--判断是否已经扣点-->
<?php echo $content;?>
<?php } else { ?>
<span style='background:#E4F5FA'><a href='readpoint.php?contentid=<?php echo $contentid;?>'>阅读本文需要消耗<font color='red'><?php echo $readpoint;?></font>点，您确认查看吗？</a></span>
<?php } ?>
<?php } else { ?>
<font color="#FF0000">您没有权限阅读</font>
<?php } ?>
  </div>
      <?php if($keywords) { ?>
      <div id="keyword"><strong>关键词：</strong><?php echo $keywords;?></div>
      <?php } ?>
      <?php if($titles) { ?>
      <div id="titles">
        <h3>本文导航</h3>
        <?php echo $titles;?> </div>
      <?php } ?>
      <!--分页-->
      <div id="pages"><?php echo $pages;?></div>
      <!--心情指数模块-->
      <?php if(isset($MODULE[mood])) { ?>
      <div id="moodrank_div"></div>
      <script  type="text/javascript">var contentid = <?php echo $contentid;?>;</script>
      <script type="text/javascript" id="callback_js"></script>
      <script type="text/javascript" src="data/moodrank/1.js"></script>
      <?php } ?>
      <?php if(isset($MODULE[digg])) { ?>
  <div id="digg_div"></div>
  <script  type="text/javascript">var contentid = <?php echo $contentid;?>; var catid = <?php echo $r['catid'];?></script>
  <script type="text/javascript" id="calldigg_js"></script>
      <script type="text/javascript" src="<?php echo $MODULE['digg']['url'];?>digg.php?contentid=<?php echo $contentid;?>&catid=<?php echo $r['catid'];?>"></script>
      <?php } ?>
<div class="clear"></div>
    <div class="box" style="margin-top:1%;">
      <h3>相关文章</h3>
      <ul class="text_list">
        <?php echo tag('phpcms', 'tag_content', "SELECT DISTINCT c.contentid,c.title,c.style,c.url FROM `phpcms_content` c,`phpcms_content_tag` t  WHERE c.contentid=t.contentid and c.`status`=99 AND t.`tag` IN(".get_sql_in($r[keywords]).") ORDER BY c.contentid DESC", 0, 10, array (  'class' => 'url',  'target' => '_blank',  'titlelen' => '46',));?> 
      </ul>
    </div>
      <div class="clear"></div>
      <?php if(isset($MODULE[mail])) { ?>
      <form action="<?php echo $MODULE['mail']['url'];?>sendmail.php" name="sendmail" id="sendmail">
        <input type="hidden" name="title" value="推荐：<?php echo $title;?>" />
        <input type="hidden" name="content" value=" <a href='<?php echo SITE_URL;?><?php echo $url;?>' target='_blank'><?php echo $title;?></a><br/>" />
      </form>
      <?php } ?>
       <?php if(isset($MODULE[error_report])) { ?>
      <form action="<?php echo $MODULE['error_report']['url'];?>error_report.php" name="errors" id="errors">
        <input type="hidden" name="title" value="<?php echo $title;?>" />
<input type="hidden" name="contentid" value="<?php echo $contentid;?>" />
      </form>
      <?php } ?>
      <p id="text_1" style="margin-top:1%;">
        <?php if(isset($MODULE[error_report])) { ?><a href="javascript:$('#errors').submit();">[错误报告]</a><?php } ?> 
        <?php if(isset($MODULE[mail])) { ?><a href="javascript:$('#sendmail').submit();">[推荐]</a><?php } ?> 
        <a href="member/collect.php?contentid=<?php echo $contentid;?>&action=add">[收藏]</a>
        <a href="javascript:window.print();">[打印]</a> <a href="javascript:window.close();">[关闭]</a> 
        <a href="<?php echo SITE_URL;?><?php echo $url;?>#top">[返回顶部]</a> </p>

      <!--评论-->
      <?php if(isset($MODULE[comment])) { ?>
      <?php list($keyid, $verify) = keyid_make('phpcms', 'content', 'title', $contentid);?>
      <div id="commnent_tag">
        <a href="<?php echo $MODULE['comment']['url'];?>?keyid=<?php echo $keyid;?>&verify=<?php echo $verify;?>"><img src="images/comment.gif" />
        已有<strong class="c_red"><span id="comments">0</span></strong>位网友发表了看法</a>
      </div>
      <div class="commenttext" style="text-align:center;margin-top:2%">
        <form action="<?php echo $MODULE['comment']['url'];?>?action=addpost" method="post" onSubmit="return checkForm();">
<input type="hidden" name="keyid" value="<?php echo $keyid;?>"/>
<input type="hidden" name="verify" value="<?php echo $verify;?>"/>
<ul>
          <li>
            <textarea cols="100" rows="8" name="comment" id="comment" onfocus="reply_clearfield()" onblur="reply_restoration()"></textarea>
          </li>
          <li style="text-align:left;margin-left:1%;margin-top:1%;">
            <span id="checker"><div style="float:left">验证码：</div><input type="text" style="ime-mode: disabled;" size="6" id="checkcode" name="checkcode" /><img src="" id="code_img" style="display:none" onclick="this.src='checkcode.php?'+Math.random()" alt="点击换一张"></span>
            <input id="dosubmit" name="dosubmit" type="submit" value="发表评论" />
          </li>
        </ul>
        </form>
      </div>
      <script type="text/javascript" src="data/js/comment_setting.js"></script>
      <script type="text/javascript">
      <!--
        $().ready(function() {        
            if(setting.ischecklogin == 0 && getcookie('auth') === null)
            {
                $('#comment').val("请您登陆后发表评论！");
                $('#comment').attr("disabled","disabled");
                $('#dosubmit').attr("disabled","disabled");
            }
            else 
            {
                $('#comment').val("我也来说两句！");
            }
        });
        function reply_restoration()
        {
            if($('#comment').val() == '')
            {
                $('#comment').val("我也来说两句！");
            }
        }
        function reply_clearfield()
        {
            if ($('#comment').val() == "我也来说两句！") 
            {
                $('#comment').val("");   
            }
document.getElementById('code_img').style.display = 'block';document.getElementById('code_img').src='checkcode.php';
        }
        function checkForm()
        {
            if($('#comment').val() == '' || $('#comment').val() == "我也来说两句！")
            {
                alert("内容不能为空");
                $('#comment').focus();
                return false;
            }
            if($('#checkcode').val() == '' )
            {
                alert("验证码不能为空");
                $('#checkcode').focus();
                return false;
            }
            if ($('#comment').val().length > 1000) 
            {
                alert("内容太长，最多 1000 个文字");
                return false;
            }
        }
      //-->
      </script>
    <?php } ?> 
    </div>
    
  </div>
  <div id="main_r">
    <!--广告位-->
    <div class="ad_side">
      <script language="javascript" src="data/js.php?id=5"></script>
    </div>
    <h4>最新图片文章</h4>
    <div>
      <ul class="pic_list">
        <?php echo tag('phpcms', 'tag_content_pic', "SELECT contentid,catid,typeid,areaid,title,style,thumb,keywords,description,userid,updatetime,inputtime,url FROM `phpcms_content` WHERE  status=99   AND  `thumb`!='' ".get_sql_catid($catid)." ORDER BY contentid DESC", 0, 4, array (  'class' => 'url',  'target' => '_blank',  'titlelen' => '14',  'height' => '62',  'width' => '87',));?>
      </ul>
    </div>
    <h4>最新文章</h4>
    <div>
      <ul class="text_list">
        <?php echo tag('phpcms', 'tag_content', "SELECT contentid,catid,typeid,areaid,title,style,thumb,keywords,description,userid,updatetime,inputtime,url FROM `phpcms_content` WHERE  status=99  ".get_sql_catid($catid)." ORDER BY contentid DESC", 0, 10, array (  'class' => 'url',  'target' => '_blank',  'titlelen' => '46',));?>
      </ul>
    </div>
<?php echo block("list_article", 1);?>
  </div>
</div>
<!--end main-->
<script language="JavaScript" src="count.php?contentid=<?php echo $contentid;?>"></script>
<?php include template('phpcms','footer'); ?>